home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Bowers Development / Demo AppMaker / Examples / Pascal OS8 / Everything / EverythingEngine.p < prev    next >
Encoding:
Text File  |  1998-10-30  |  4.2 KB  |  196 lines  |  [TEXT/CWIE]

  1. { EverythingEngine.p -- application-specific data management }
  2. { Created 10/30/98 1:06 PM by AppMaker }
  3.  
  4. { This module contains data structures to access the data in your }
  5. { document's file(s). The purpose is to isolate the details of the }
  6. { data representation into this module and to provide accessor }
  7. { functions for reading/writing logical pieces of the data. }
  8. { For your application, you will probably rewrite most of this. }
  9. { This module will not be regenerated by AppMaker unless you delete it. }
  10.  
  11. Unit EverythingEngine;
  12. Interface
  13.  
  14. Uses
  15.     Types,
  16.     Quickdraw,
  17.     Controls,
  18.     Events,
  19.     Files,
  20.     Lists,
  21.     Menus,
  22.     DDocData,
  23.     DModalCheckboxesData,
  24.     DModalRadiosData,
  25.     DModalTextData,
  26.     DModalStuffData,
  27.     DModalBarsData,
  28.     DModelessCheckboxesData,
  29.     DModelessRadiosData,
  30.     DModelessTextData,
  31.     DModelessStuffData,
  32.     DModelessBarsData,
  33.     TextEdit,
  34.     AMEngine;
  35.  
  36. const
  37.     kSignature        = 'XXXX';
  38.     kFileType        = 'TEXT';
  39.  
  40. type
  41.     EverythingEngine        = object (AMEngine)
  42.  
  43.     {data members}
  44.  
  45.     {methods - public}
  46.         Procedure Initialize; Override;
  47.  
  48.         Function  GetDocData: DDocData;
  49.         Function  GetModalCheckboxesData: DModalCheckboxesData;
  50.         Function  GetModalRadiosData: DModalRadiosData;
  51.         Function  GetModalTextData: DModalTextData;
  52.         Function  GetModalStuffData: DModalStuffData;
  53.         Function  GetModalBarsData: DModalBarsData;
  54.         Function  GetModelessCheckboxesData: DModelessCheckboxesData;
  55.         Function  GetModelessRadiosData: DModelessRadiosData;
  56.         Function  GetModelessTextData: DModelessTextData;
  57.         Function  GetModelessStuffData: DModelessStuffData;
  58.         Function  GetModelessBarsData: DModelessBarsData;
  59.  
  60.     {methods - internal}
  61.         Procedure InitData; Override;
  62.         Procedure DisposeData; Override;
  63.         Procedure ReadFile; Override;
  64.         Procedure WriteFile; Override;
  65.     end;
  66.  
  67. {----------}
  68. Function NewEverythingEngine: EverythingEngine;
  69.  
  70. {----------}
  71. Implementation
  72.  
  73. Uses
  74.     Globals,
  75.     Miscellany;
  76.  
  77. {----------}
  78. Function NewEverythingEngine: EverythingEngine;
  79. var
  80.     engine:        EverythingEngine;
  81. begin
  82.     New (engine);
  83.     if engine <> nil then begin
  84.         engine.Initialize;
  85.     end;
  86.     NewEverythingEngine := engine;
  87. end;
  88.  
  89. {----------}
  90. Procedure EverythingEngine.Initialize;
  91. begin
  92.     inherited Initialize;
  93.  
  94.     mFileType := kFiletype;
  95.     mSignature := kSignature;
  96. end;
  97.  
  98. { These are just models for your own data access functions. }
  99. { Replace them with ones that do something useful. }
  100.  
  101. {----------}
  102. Function EverythingEngine.GetDocData: DDocData;
  103. begin
  104.     GetDocData := NewDDocData;
  105. end;
  106.  
  107. {----------}
  108. Function EverythingEngine.GetModalCheckboxesData: DModalCheckboxesData;
  109. begin
  110.     GetModalCheckboxesData := NewDModalCheckboxesData;
  111. end;
  112.  
  113. {----------}
  114. Function EverythingEngine.GetModalRadiosData: DModalRadiosData;
  115. begin
  116.     GetModalRadiosData := NewDModalRadiosData;
  117. end;
  118.  
  119. {----------}
  120. Function EverythingEngine.GetModalTextData: DModalTextData;
  121. begin
  122.     GetModalTextData := NewDModalTextData;
  123. end;
  124.  
  125. {----------}
  126. Function EverythingEngine.GetModalStuffData: DModalStuffData;
  127. begin
  128.     GetModalStuffData := NewDModalStuffData;
  129. end;
  130.  
  131. {----------}
  132. Function EverythingEngine.GetModalBarsData: DModalBarsData;
  133. begin
  134.     GetModalBarsData := NewDModalBarsData;
  135. end;
  136.  
  137. {----------}
  138. Function EverythingEngine.GetModelessCheckboxesData: DModelessCheckboxesData;
  139. begin
  140.     GetModelessCheckboxesData := NewDModelessCheckboxesData;
  141. end;
  142.  
  143. {----------}
  144. Function EverythingEngine.GetModelessRadiosData: DModelessRadiosData;
  145. begin
  146.     GetModelessRadiosData := NewDModelessRadiosData;
  147. end;
  148.  
  149. {----------}
  150. Function EverythingEngine.GetModelessTextData: DModelessTextData;
  151. begin
  152.     GetModelessTextData := NewDModelessTextData;
  153. end;
  154.  
  155. {----------}
  156. Function EverythingEngine.GetModelessStuffData: DModelessStuffData;
  157. begin
  158.     GetModelessStuffData := NewDModelessStuffData;
  159. end;
  160.  
  161. {----------}
  162. Function EverythingEngine.GetModelessBarsData: DModelessBarsData;
  163. begin
  164.     GetModelessBarsData := NewDModelessBarsData;
  165. end;
  166.  
  167.  
  168. {----------}
  169. Procedure EverythingEngine.InitData;
  170. begin
  171.     {override to initialize your data structures}
  172. end;
  173.  
  174. {----------}
  175. Procedure EverythingEngine.DisposeData;
  176. begin
  177.     {override to dispose your data structures}
  178. end;
  179.  
  180. {----------}
  181. Procedure EverythingEngine.ReadFile;
  182. begin
  183.     InitData;
  184.     mDirty := false;
  185.     {override to read from the current file into your data structures}
  186. end;
  187.  
  188. {----------}
  189. Procedure EverythingEngine.WriteFile;
  190. begin
  191.     mDirty := false;
  192.     {override to write your data structures to the current file}
  193. end;
  194.  
  195. end.
  196.